/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package upeu.edu.pe.model;

import java.io.Serializable;
import java.math.BigDecimal;
import java.util.Collection;
import javax.persistence.Basic;
import javax.persistence.CascadeType;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.OneToMany;
import javax.persistence.Table;
import javax.xml.bind.annotation.XmlRootElement;
import javax.xml.bind.annotation.XmlTransient;

/**
 *
 * @author DANIEL
 */
@Entity
@Table(name = "SAU_EVALUADOR")
@XmlRootElement
@NamedQueries({
    @NamedQuery(name = "SauEvaluador.findAll", query = "SELECT s FROM SauEvaluador s"),
    @NamedQuery(name = "SauEvaluador.findByIdEvaluador", query = "SELECT s FROM SauEvaluador s WHERE s.idEvaluador = :idEvaluador")})
public class SauEvaluador implements Serializable {
    private static final long serialVersionUID = 1L;
    // @Max(value=?)  @Min(value=?)//if you know range of your decimal fields consider using these annotations to enforce field validation
    @Id
    @Basic(optional = false)
    @Column(name = "ID_EVALUADOR")
    private BigDecimal idEvaluador;
    @OneToMany(cascade = CascadeType.ALL, mappedBy = "idEvaluador")
    private Collection<SauEstandarEvaluacion> sauEstandarEvaluacionCollection;
    @JoinColumn(name = "ID_PERSONA", referencedColumnName = "ID_PERSONA")
    @ManyToOne(optional = false)
    private SauPersona idPersona;

    public SauEvaluador() {
    }

    public SauEvaluador(BigDecimal idEvaluador) {
        this.idEvaluador = idEvaluador;
    }

    public BigDecimal getIdEvaluador() {
        return idEvaluador;
    }

    public void setIdEvaluador(BigDecimal idEvaluador) {
        this.idEvaluador = idEvaluador;
    }

    @XmlTransient
    public Collection<SauEstandarEvaluacion> getSauEstandarEvaluacionCollection() {
        return sauEstandarEvaluacionCollection;
    }

    public void setSauEstandarEvaluacionCollection(Collection<SauEstandarEvaluacion> sauEstandarEvaluacionCollection) {
        this.sauEstandarEvaluacionCollection = sauEstandarEvaluacionCollection;
    }

    public SauPersona getIdPersona() {
        return idPersona;
    }

    public void setIdPersona(SauPersona idPersona) {
        this.idPersona = idPersona;
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (idEvaluador != null ? idEvaluador.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof SauEvaluador)) {
            return false;
        }
        SauEvaluador other = (SauEvaluador) object;
        if ((this.idEvaluador == null && other.idEvaluador != null) || (this.idEvaluador != null && !this.idEvaluador.equals(other.idEvaluador))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "upeu.edu.pe.model.SauEvaluador[ idEvaluador=" + idEvaluador + " ]";
    }
    
}
